/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package client;

import java.net.DatagramSocket;
import java.util.ArrayList;

/**
 *
 * @author rmb
 */
public class Receive extends Thread{
 
    private DatagramSocket socket;
    private boolean finished;
    private int receivedAcks;
    private ArrayList losses;
    private boolean ended;

    public Receive(DatagramSocket socket) {
        this.socket = socket;
        finished = false;
        receivedAcks = 0;
        losses = new ArrayList();
        ended = false;
    }
  
    
    public void setEnded() {
        ended = true;
    }
    
    public void setFinished() {
        finished = true;
    }           
    
    public boolean isEnded() {
        return ended;
    }

    public boolean isFinished() {
        return finished;
    }
        

    public ArrayList getLosses() {
        return losses;
    }
        

    public int getReceivedAcks() {
        return receivedAcks;
    }

    public DatagramSocket getSocket() {
        return socket;
    }

    public void setEnded(boolean ended) {
        this.ended = ended;
    }

    public void setFinished(boolean finished) {
        this.finished = finished;
    }

    public void setLosses(ArrayList losses) {
        this.losses = losses;
    }

    public void setReceivedAcks(int receivedAcks) {
        this.receivedAcks = receivedAcks;
    }

    public void setSocket(DatagramSocket socket) {
        this.socket = socket;
    }
    
    public void addLoss(int i) {
        losses.add(i);
    }
    
    
    
}
